package _15_Constructors;

public class Car1 
{
	String model;
	double maxSpeed;
	int currentSpeed;
	String color = "white";
	int currentGear;
	
	double price;
	boolean isSportCar = true;
	Person1 owner;
	
	Car1()
	{
		isSportCar = false;
	}
	Car1(String model)
	{
		this.model = model;

	}
	
	Car1(String model, String color)
	{
		this();
		this.color = color;
	}
	
	Car1(String model, boolean isSportCar, String color, double price, double maxSpeed)
	{
		this(model, color);
		this.model = model;
		this.isSportCar = isSportCar;
		this.color = color;
		this.price = price;
		this.maxSpeed = maxSpeed;
		
		if(maxSpeed > 200 &&isSportCar)
		{
			this.maxSpeed = maxSpeed;
		}
		else
		{
			this.maxSpeed = 150;
		}
	}
	
	public boolean isMoreExpensive(Car1 car)	
	{
		return this.price > car.price;
	}
	
//	public double calculateCarPriceForScrap(double metalPrice)
//	{
//		double coef = 0.2;
//		if(this.color == "black" || this.color == "white")
//		{
//			coef += 0.05;
//		}
//		if(this.isSportCar == true)
//		{
//			coef += 0.05;
//		}
//		return metalPrice * coef;
//	}
		
	void changeOwner(Person1 newOwner)
	{
		this.owner = newOwner;
	}
	
}
